﻿@using Classified.Web.Services
@model Classified.Web.Models.LogOnModel
<ul class="nav nav-pills pad0" style="float: right">
    @if (Request.IsAuthenticated)
    {
        var ctx = new FormsAuthenticationService(this.Context);

      
        
        if (ctx.GetAuthenticatedUser() != null)
        {
            var data = ctx.GetAuthenticatedUser();
            foreach (var i in data.Roles)
            {
                if (i.RoleName == "Admin")
                {
        <li>
            @Html.ActionLink("Administration", "Index", "Admin", new { area = "admin" }, new { })</li>
                }

            }

        }
         
       
        <li><a>Welcome <strong>@User.Identity.Name</strong>! </a>
         <li>
            <a href="@Url.Action("MyAds", "Home")"><i class="icon-user"></i>&nbsp;My Ads</a>
          
        </li>
        </li>
        <li>
            <a href="@Url.Action("LogOff", "Account")"><i class="icon-off"></i>&nbsp;Log Off</a>
          
        </li>
        
    }
    else
    { 
        <li class="drop down">
            @Html.ActionLink("Sign In", "LogOn", "Account")
            @*@if (Html.IsLogOnPage())
            {
                <text>
                    @Html.ActionLink("Log On", "LogOn", "Account")
                </text>
                         
            }
            else
            {
                <text>
                    @Html.Partial("_LogOnPortialPopUp", new Classified.Web.Models.LogOnModel())
                </text>

            }*@
        </li>
        <li><a href="@Url.Action("Register", "Account")">Register</a></li>
    }
</ul>
